class Solution:
    def consecutiveNumbersSum(self, n: int) -> int:
        ans = 0

        now = 1
        while n >= now:
            if n % now == 0:
                ans += 1
            n -= now
            now += 1

        return ans


if __name__ == "__main__":
    print(Solution().consecutiveNumbersSum(5))  # 2
    print(Solution().consecutiveNumbersSum(9))  # 3
    print(Solution().consecutiveNumbersSum(15))  # 4
